<html>
  <body>

    <input placeholder="输入一些文本" name="name" />
    <p id="values"></p>
  </body>

  <script>


const input = document.querySelector("input");
const log = document.getElementById("values");

input.addEventListener("input", updateValue);

function updateValue(e) {
  console.log(e)
  log.textContent = e.target.value;
}

  </script>
</html>